<template>
	<u-tabbar
		:value="value1"
		@change="change1"
		:fixed="true"
		:placeholder="false"
		:safeAreaInsetBottom="false"
		activeColor="#D0587C"
		inactiveColor="#d0b0b7"
	>
		<u-tabbar-item v-for="(item,index) in list" :text="item.text" :icon="item.icon"></u-tabbar-item>
	</u-tabbar>
</template>

<script>
	export default {
		name:"tabbar",
		data() {
			return {
				list : [
					{
						text : '主页',
						icon : 'home',
						path : 'pages/index/index'
					},
					{
						text : '分类',
						icon : 'list',
						path : 'pages/protection/protection'
					},
					{
						text : '我',
						icon : 'account',
						path : 'pages/user/user'
					}
				]
			};
		},
		methods:{
			change1(e){
				uni.switchTab({
					url:'/' + this.list[e].path
				})
				
			}
		},
		props:['value1']
	}
</script>

<style lang="scss">
	/deep/.u-tabbar-item{
		background-color: #faeef2;
		color: red;
	}
	
</style>